#include <iostream>
#include <vector>
#include <string>
#include <stdio.h>
#include <stdarg.h>
#include "game_version.h"
#include "game_thread.h"
#include "game_log.h"
#include "game_http.h"
#include <event2/buffer.h>
#include <event2/buffer_compat.h>
#include <unistd.h>
#include "game_util.h"
#include "game_string.h"
#include "game_application.h"
#include "game_file.h"
#include "game_ev.h"



class CApp:public CGameApplication{
protected:
  void doRun();
};

void CApp::doRun(){}


int main()
{
  int ret = 0;
  char vStr[128];
  __vstring(vStr);
  UINT32 v = __version(1,1,0);
  __log("ver %d\n",v);

  CGameVersion_t s;
  __version(&s,16842752);
  __log("Hello World from %d.%d.%d\n",s._major,s._minor,s._patch);
  __log("Hello World from %s\n",vStr);
  // CApp ttt;
  // ttt.run();

  __ev_config();

  // char uuid[128] = {0};

  // int ret = __get_uuid(uuid);
  // __log("uuid is %s size %d\n",uuid,ret);

  // char gmt[128] = {0};
  // __gmtime_format(gmt);
  
  // __log("gmt is %s\n",gmt);

  // char gmt_add[128] = {0};
  // __gmtime_add(10,gmt_add);
  
  // __log("gmt_add is %s\n",gmt_add);

  // std::string str{"/public/index"};

  // std::string parent = __get_file_parent("/var/log/ebsx/main/main.log");
  // __log("parent:%s\n",parent.c_str());
  // ret = __mkdirs(parent);

  // __log("is starwith %s\n",__string_startwith(str,"/public") ? "TRUE":"FALSE");

  CApp app;
  

  do{
    CC_BREAK_IF(!app.init());
    app.run();
  }while(true);
  return ret;
}
